Select Command (Traverse Tables)

TcaplusDB Client - Select Command (Traverse Tables)

For TcaplusDB Client Instructions, see Document.

1. Function Descriptions

Traverse all the data in the table. It supports viewing the values of all or partial fields of the data. It is the default to traverse data from the slave copy.

If you need to modify the records in the queried file and then update them to the server, use the load command.

Please note that for the List table, the load command will directly insert a new record. If you need to update the original record on the server, use the update command and specify the index.

Please note that the file name for saving query results cannot start with a number.

When the command executed with select does not match any index, it is equivalent to the dump command.

2. Initial Version

3.40.0

3. Command Syntax

select key1, key2, key3, value1, value2 [into result.csv] from table [where ...] [\P] [\G] [\S] [using tdr] [encode]
select * [into result.xml] from table using tdr [\P];
pb table specifies field query export (supported in version 3.55):
enable delta result;
select key1, key2, key3, value1, value2 [into result.xml] from table;

Parameter description:

ParameterPB TableTDR TableRequired
tableTable nameTable nameYes
valueNon-primary key field nameNon-primary key field nameAt least one or *
intoExport data to file(In version 3.55, the feature to export specific fields is supported, and you need to execute the enable delta result setting in advance.)Export data to fileNo
using tdrDo not supportIf this parameter is required, it needs to specify the TDR file corresponding to the target table through the startup parameters at the time of starting the TcaplusDB Client.No
whereVersions after 3.55.0 support Filter ConditionsSame as PB tableNo
encodeNot supported (carriage return or invisible characters have been preprocessed)After specifying this parameter, the dump command will encode the string type field value containing carriage return characters or invisible characters into BASE64 before outputting.
Note: This parameter takes effect only when it is specified using tdr
No

4. Command Example

See Table Definition Example for table definition.

tcaplus> select * from test_table;
[Execute] as dump command.
[Execute] read from slave.
TimeKey,GameSvrID,GameAppID,OnlineCntIOS,OnlineCntAndroid,strstr
1,2,"",0,0,""
1,1,"",0,0,""
1,3,"",0,0,""

total 3 records successful

offset: 4294967300 shardid: 1

used time: 20226 us

5. Common Errors

Refer to Common Errors.

[TDR Generic Table] [C++ SDK] Interface Description for Traversing Tables.

[TDR Generic Table] [Java SDK] Interface Description for Traversing Tables.

[TDR Generic Table] [Go SDK] Interface Description for Traversing Tables.

[TDR List Table] [C++ SDK] Interface Description for Traversing Tables.

[TDR List Table] [Java SDK] Interface Description for Traversing Tables.

[PB Generic Table] [C++ SDK] Interface Description for Traversing Tables.

[PB Generic Table] [Go SDK] Interface Description for Traversing Tables.

[PB Generic Table] [RESTFul API] Interface Description for Traversing Tables.

[PB List Table] [C++ SDK] Interface Description for Traversing Tables.

[PB Generic Table] [Go SDK] Interface Description for Traversing Tables.

[PB List Table] [RESTFul API] Interface Description for Traversing Tables.